using System;
using System.Collections.Generic;
using System.Text;

namespace TcKs.MSOffice.WrapperAssembliesCodeGenerator.Model {
	/// <summary>
	/// Interface for definition of attribute.
	/// </summary>
	public interface IAttributeDef {
		/// <summary>
		/// Instance of attribute.
		/// </summary>
		object Attribute { get;set;}
	}

	/// <summary>
	/// Base class for definition of attribute.
	/// </summary>
	[Serializable]
	public abstract class AttributeDefBase : IAttributeDef {
		protected abstract object AttributeInternal { get;set;}
		object IAttributeDef.Attribute {
			get { return this.AttributeInternal; }
			set { this.AttributeInternal = value; }
		}
	}

	/// <summary>
	/// Common class for definition of attribute.
	/// </summary>
	[Serializable]
	public class AttributeDef : AttributeDefBase {
		private object z_Attribute;
		/// <summary>
		/// Instance of attribute.
		/// </summary>
		public object Attribute {
			get { return this.z_Attribute; }
			set { this.z_Attribute = value; }
		}
		protected override object AttributeInternal {
			get { return this.Attribute; }
			set { this.Attribute = value; }
		}

		public AttributeDef() { }
		public AttributeDef( object attribute ) {
			this.Attribute = attribute;
		}
	}

	/// <summary>
	/// Generic interface for definition of specified attribute.
	/// </summary>
	/// <typeparam name="T_ATTRIBUTE">Type of attribute</typeparam>
	public interface IAttributeDef<T_ATTRIBUTE> : IAttributeDef where T_ATTRIBUTE : Attribute {
		new T_ATTRIBUTE Attribute { get;set;}
	}

	/// <summary>
	/// Generic class for definition of specified attribute.
	/// </summary>
	/// <typeparam name="T_ATTRIBUTE">Type of attribute</typeparam>
	[Serializable]
	public class AttributeDef<T_ATTRIBUTE> : AttributeDefBase, IAttributeDef<T_ATTRIBUTE> where T_ATTRIBUTE : Attribute {
		private T_ATTRIBUTE z_Attribute;
		/// <summary>
		/// Instance of attribute.
		/// </summary>
		public T_ATTRIBUTE Attribute {
			get { return this.z_Attribute; }
			set { this.z_Attribute = value; }
		}
		protected override object AttributeInternal {
			get { return this.Attribute; }
			set { this.Attribute = (T_ATTRIBUTE)value; }
		}

		public AttributeDef() { }
		public AttributeDef( T_ATTRIBUTE attribute ) {
			this.Attribute = attribute;
		}
	}
}
